Connectivity Software User's Guide and Reference
ToGoodValueResult(Func<Exception,Exception>) Method



OpcLabs.EasyOpcUAPrimitives Assembly > OpcLabs.EasyOpc.UA.OperationModel Namespace > UAAttributeDataResult Class > ToGoodValueResult Method : ToGoodValueResult(Func<Exception,Exception>) Method
A function to transform exceptions before including them in the result.

The value of this parameter cannot be null (Nothing in Visual Basic).

Converts this attribute data result to a OpcLabs.BaseLib.OperationModel.ValueResult, ensuring the status is good.
Syntax
'Declaration
 
<JetBrains.Annotations.NotNullAttribute()>
Public Overloads Function ToGoodValueResult( _
   ByVal exceptionTransformingFunction As Func(Of Exception,Exception) _
) As ValueResult
'Usage
 
Dim instance As UAAttributeDataResult
Dim exceptionTransformingFunction As Func(Of Exception,Exception)
Dim value As ValueResult
 
value = instance.ToGoodValueResult(exceptionTransformingFunction)
[JetBrains.Annotations.NotNull()]
public ValueResult ToGoodValueResult( 
   Func<Exception,Exception> exceptionTransformingFunction
)
[JetBrains.Annotations.NotNull()]
public:
ValueResult^ ToGoodValueResult( 
   Func<Exception^,Exception^>^ exceptionTransformingFunction
) 

Parameters

exceptionTransformingFunction
A function to transform exceptions before including them in the result.

The value of this parameter cannot be null (Nothing in Visual Basic).

Return Value

A OpcLabs.BaseLib.OperationModel.ValueResult representing the operation outcome, with non-good status codes converted to exceptions.

This method never returns null (Nothing in Visual Basic).

Remarks

This method converts the attribute data result to a value result. If the status code is not good, it creates an exception using OpcLabs.EasyOpc.UA.UAStatusCodeException and transforms it using the provided function.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also